package com.baice.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;

@Configuration
public class AppConfig {
//完成AppConfig的注册，并基于java代码的方式初始化DispatcherServlet
    @Bean
    public DispatcherServlet getDispatcherServlet( AnnotationConfigWebApplicationContext ac ){
        return  new DispatcherServlet(ac);
    }
}
